import request from '@/utils/request'

// 获取文章列表
export function getArticleList(params) {
  return request({
    url: '/blog-core/back/article/list',
    method: 'get',
    params
  })
}

// 获取文章详情
export function getArticle(id) {
  return request({
    url: '/blog-core/back/article/' + id,
    method: 'get'
  })
}

// 添加或更新文章
export function addOrUpdate(data) {
  return request({
    url: '/blog-core/back/article/addOrUpdate',
    method: 'post',
    data
  })
}

// 删除文章
export function deleteArticle(id) {
  return request({
    url: '/blog-core/back/article/' + id,
    method: 'delete'
  })
}
